package cardval.dao;

import cardval.entity.Admin;
import cardval.entity.PartnerInfo;
import cardval.util.StringUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * <ul>
 * <li>
 * add reason
 * </li>
 * </ul>
 * 2017/8/12
 * 下午3:50
 * cardval.dao
 * d-night
 *
 * @author Lu.Bing
 */
@Repository("adminDao")
public class AdminDao {
    @Resource
    private JdbcTemplate jdbcTemplate;

    public List<Admin> queryAdmin(String username) {
        String sql = "SELECT * FROM admin where username = '" + username + "'";
        return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Admin.class));
    }
}
